package com.wc.alorithm_blue_bridge._思维.Q4169;

import java.io.*;

/**
 * @Author congege
 * @Description 鸡哥的购物挑战
 * https://www.lanqiao.cn/problems/4169/learning/?page=1&first_category_id=1
 * @Date Created in 2023/11/23-22:18
 */
public class Main {
    public static void main(String[] args) {
        Input sc = new Input();
        int n = sc.nextInt();
        // 最小的正数
        int minPos = Integer.MAX_VALUE;
        // 最大的负值
        int maxNeg = Integer.MIN_VALUE + 1;
        int curN = 0;
        long ans = 0;
        while (n-- > 0) {
            int num = sc.nextInt();
            if (num >= 0) {
                minPos = Math.min(minPos, num);
                ans += num;
                curN++;
            } else {
                maxNeg = Math.max(maxNeg, num);
            }
        }
        if (curN % 2 == 1) {
            // 当最大的负值比最大的正值小的时候，说明再添加一个还是有增益的
            if (minPos > Math.abs(maxNeg)) {
                ans += maxNeg;
            } else {
                ans -= minPos;
            }
        }
        System.out.println(ans);
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (Exception e) {
                return -1;
            }
            return (int) in.nval;
        }
    }
}
